package org.neuedu.chapter09_0701.demo03;

import java.time.*;

public class NewApi {
    public static void main(String[] args) {
        // jdk8 新的api
        LocalDate date = LocalDate.now();
        System.out.println(date);

        LocalTime time = LocalTime.now();
        System.out.println(time);

        LocalDateTime dateTime = LocalDateTime.now();
        System.out.println(dateTime);

        LocalDate date1 = LocalDate.of(2008, 9, 8);
        System.out.println(date1);

        int year = date1.getYear();
        int monthValue = date1.getMonthValue();
        int day1 = date1.getDayOfMonth();

        DayOfWeek week = date1.getDayOfWeek();
        int value = week.getValue();
        System.out.println("dayOfWeek:"+value);

        System.out.println(year);
        System.out.println(monthValue);
        System.out.println(day1);

        LocalTime date2 = LocalTime.of(16, 22, 55);
        System.out.println(date2);

    }
}
